package com.casi.demo.validation;

import java.awt.image.BufferedImage;

import java.io.*;

/**
 * User: xiujguo
 * Date: 12-4-6
 * Time: 下午1:23
 */
public class Validation {
      //validation framwork


   public static void  valiImg(File file) throws IOException {
       try{
           BufferedImage  sourceImg = javax.imageio.ImageIO.read(new FileInputStream(file));
           System.out.println("width = "+sourceImg.getWidth() + "height = " + sourceImg.getHeight());
       }
           catch(Exception e){
               System.err.print(";;;;;;;;;;"+e.toString());
           }
   }


    public static void main(String[] args) {

        try {
            File file=new File("C:\\Users\\Public\\Pictures\\Sample Pictures\\Jellyfisdh.jpg");
            valiImg(file);
        } catch (IOException e) {
            System.out.println(e.getStackTrace());
        }
    }
}
